import axios from 'axios'
import { axiosInstance } from './config'

export const getBannerRequest = () => {
  return axiosInstance.get('/banner')
}
export const getRecommendListRequest = () => {
  return axiosInstance.get('/personalized')
}

export const getHotSingerListRequest = offset => {
  return axiosInstance.get(`/top/artists?offset=${offset}`)
}
// offset: 偏移数量，用于分页
// initial: 按首字母索引查找参数
export const getSingerListRequest = (type, area, alpha, offset) => {
  return axiosInstance.get(
    `/artist/list?type=${type}&area=${area}&initial=${alpha.toLowerCase()}&offset=${offset}`
  )
}
// 获取所有榜单内容摘要
export const getRankListRequest = () => {
  return axiosInstance.get('/toplist/detail')
}

export const getAlbumDetailRequest = id => {
  return axiosInstance.get(`/playlist/detail?id=${id}`)
}

export const getSingerRequest = id => {
  return axiosInstance.get(`/artists?id=${id}`)
}

export const getSongDetailRequest = id => {
  return axiosInstance.get(`/song/detail?ids=${id}`)
}
